//
//  ViewController.m
//  Menu
//
//  Created by ZF on 16/12/21.
//  Copyright © 2016年 ZhuFeng. All rights reserved.
//

#import "ViewController.h"
#import "MenuView.h"
#import "CCZTableButton.h"
@interface ViewController () <AddMenuOperation>
{
    CCZTableButton *table;
    MenuView *menu;
}
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor yellowColor];
    
    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
    button.frame = CGRectMake(50, 100, 150, 50);
    button.backgroundColor = [UIColor blueColor];
    [button setTitle:@"点一下" forState:UIControlStateNormal];
    [button addTarget:self action:@selector(onClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:button];
    
    menu = [[MenuView alloc] initWithSetCellLabelTextWithArray:@[@"支付宝",@"微信支付",@"QQ钱包",@"财付通"] menuPoint:CGPointMake(85, 170) withMenuStyle:MenuDefaultStyle];
    menu.delegate = self;
    [self.view addSubview:menu];
    
   
}

- (void)onClick
{
    if(menu.ifHide)
    {
        [menu display];
    }
    else [menu disappear];
}

- (void)selectCellImplementAtIndexRow:(NSInteger)rowNumber;

{
    if(rowNumber == 0)
    {
        NSLog(@"0");
        [menu repaintMenuViewAddData:@[@"新来的"]];
    }
    if(rowNumber == 1)
    {
        NSLog(@"1");
    }
    if(rowNumber == 2)
    {
        NSLog(@"2");
    }
    if(rowNumber == 3)
    {
        NSLog(@"3");
    }
    if(rowNumber == 4)
    {
        NSLog(@"4");
    }

}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
